
var test = new String();
test = "    ABCDEFG    ";

function alertText(text) {
    var mask = new String();
    mask = "'{0}'"
    alert(String.format(mask, text));
}

function showTest() {
alertText(test);
}

function startsWithTest() {
alertText(test.startsWith('    '));
// value --> true
}

function endsWithTest() {
alertText(test.endsWith('DEFG'));
// value --> false
}

function trimTest() {
alertText(test.trim());
// value --> "ABCDEFG"
}

function trimStartTest() {
alertText(test.trimStart());
// value --> "ABCDEFG    "
}

function trimEndTest() {
alertText(test.trimEnd());
// value --> "    ABCDEFG"
}

function formatTest() {
var mask = new String();
mask = "Originally '{0}' becomes '{1}' after trimming";
alertText(String.format(mask, test, test.trim()));
}
